
#ifndef __ISYSTEM_H__
#define __ISYSTEM_H__

class CMetaClassRegistry;

struct ISystem;

struct SSystemGlobalEnvironment
{
	ISystem * p_system;

	SSystemGlobalEnvironment():
		p_system(NULL)
	{}
};

struct ISystem
{
	virtual ~ISystem(){};

	virtual bool init() = 0; 

	virtual bool shutdown() = 0;

	virtual void testMem() = 0;

	virtual void * sysAlloc(size_t size) = 0;
	virtual size_t sysFree(void * p) = 0;
	virtual void sysMemInfo() = 0;

	virtual SSystemGlobalEnvironment * getSystemGlobalEnvironment() = 0;

	virtual CMetaClassRegistry * getMetaClassRegistry() = 0;
};

extern SSystemGlobalEnvironment * gEnv;

inline ISystem * getISystem()
{
	return gEnv->p_system;
};

#ifndef GS_LIB
	#ifndef GS_SYSTEM_MODULE
		#define GSSYSTEM_API DLL_IMPORT
	#else
		#define GSSYSTEM_API DLL_EXPORT
	#endif
#else
	#define GSSYSTEM_API
#endif

extern "C"
{
	GSSYSTEM_API ISystem * getSystemInterface();
}

#endif // !__ISYSTEM_H__